import { Controller, Inject, Get, Post, Body } from '@midwayjs/core'
import { UsersService } from '../../service/admin/UsersService'
import { BaseController } from '../base.chontroller'

@Controller('/users')
export class UsersController extends BaseController {
  @Inject()
  service!: UsersService

  @Get('/list')
  async list() {
    try {
      const data = await this.service.list()
      return this.success<IList<any>>(data)
    } catch (err: any) {
      return this.fail(err.message || '获取列表失败')
    }
  }
}
